package com.spark.incoicings.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.spark.invoicings.entity.PurchaseDetail;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface PurchaseDetailsMapper extends BaseMapper<PurchaseDetail> {

    /**
     * 获取所有状态为待入库的明细
     * @return
     */
    List<PurchaseDetail> selectPurchaseDetailStatusAll();

    /**
     * 根据产品id获取采购明细
     * @param productId
     * @return
     */
    List<PurchaseDetail> selectPurchaseDetailById(Integer productId);


    /**
     * 根据id获取采购明细
     * @param id
     * @return
     */
    List<PurchaseDetail> selectDetailById(Integer id);

    /**
     * 根据id获取采购明细
     * @param id
     * @return
     */
    PurchaseDetail selectPurchaseDetailsById(Integer id);

    /**
     * 查询所有采购明细
     * 分页
     * 根据订单号模糊查询
     * @param map
     * @return
     */
    List<PurchaseDetail> selectPurchaseDetailAll(Map<String, Object> map);

}
